Optional Opengl.F

{ Notes --------------------------------------
TODO:
   ARB Extensions support    DONE


Main Reference:  http://pyopengl.sourceforge.net/documentation/manual/index.xml

Flat-shaded polygons of different colors cannot be used with vertex arrays - unless you use color arrays too

Function that expect double-floats as on-stack params are avoided when possible, but "dv" functions are included as they are compatible with SwiftForth's native 64-bit floats.

For simplicity's sake, only glRasterPos2i and glRasterPos3i are included.

What is not included:
   glRect
   Texture-sub-images
   Accumulation buffers
   Feedback

-------------------------------------------- }

Only Forth Definitions
warning off

Requires DLL-TOOLS
Requires FLOAT-TOOLS
LIBRARY OpenGL32.dll

0 VOID cimport: glFlush
Function: glHint ( n n -- )
Function: glFinish ( -- )

\ Display lists
Function: glNewList ( list mode -- )
Function: glGenLists ( n -- n )
Function: glEndList ( -- )
Function: glCallList ( list -- )
Function: glCallLists  (  GLsizei-n GLenum type GLvoid-*lists -- )
Function: glDeleteLists ( list range -- )
Function: glListBase  (  GLuint-base -- )

\ Matrix
Function: glMatrixMode ( mode -- )
Function: glLoadIdentity ( -- )
Function: glPushMatrix ( -- )
Function: glPopMatrix ( -- )
Function: glRotatef ( deg x y z -- )
: glRotatef ( f: deg x y z -- )  4sfparms glRotatef ; cstyle
Function: glTranslatef ( x y z -- )
: glTranslatef ( f: x y z -- ) 3sfparms glTranslatef ; cstyle
Function: glScalef ( x y z -- )
: glScalef ( f: x y z -- ) 3sfparms glScalef ; cstyle

Function: glScaled ( x . y . z . -- )
: glScaled 3df glScaled ; cstyle


Function: glLoadMatrixd ( a -- )
Function: glLoadMatrixf ( a -- )
Function: glMultMatrixd ( a -- )
Function: glMultMatrixf ( a -- )
Function: glFrustum ( left . right . top . btm . near . far . -- )
: glFrustum  6df glFrustum ; cstyle
Function: glOrtho ( left . right . top . btm . near . far . -- )
: glOrtho  6df glOrtho ; cstyle

\ Screen
Function: glClear ( mask -- )
Function: SwapBuffers ( hdc -- bool )
Function: glClearColor ( r g b a -- )
: glClearColor   4sfparms glClearColor ; cstyle

\ General
Function: glClipPlane ( GLenum-plane GLdouble-*equation -- )    \ equation is 4 double floats
Function: glColorMaterial ( face mode -- )
Function: glDisable ( caps -- )
Function: glEnable ( caps -- )
Function: glViewport ( ix iy icx icy -- )
Function: glBegin ( mode -- )
Function: glEnd ( -- )
Function: glDrawBuffer   (  GLenum-mode -- )

\ Material
Function: glMaterialf  (  GLenum-face GLenum-pname GLfloat-param -- )
: glMaterialf 1sfparms glMaterialf ; cstyle
Function: glMateriali  (  GLenum-face GLenum-pname GLint-param -- )
Function: glMaterialfv  (  GLenum-face GLenum-pname addr -- )
Function: glMaterialiv  (  GLenum-face GLenum-pname addr -- )

\ Textures
Function: glPixelStorei ( param value -- )
Function: glPixelStoref ( param value -- )
: glPixelStoref 1sfparms glPixelStoref ; cstyle
Function: glPixelTransferf ( param value -- )
: glPixelTransferf   1sfparms glPixelTransferf ; cstyle
Function: glPixelTransferi ( param value -- )
Function: glGenTextures ( n addr -- )
Function: glDeleteTextures ( n addr -- )
Function: glBindTexture ( texture mode -- )
Function: glTexParameteri ( mode param value -- )
Function: glTexParameterf ( mode param value -- )
: glTexParameterf 1sfparms glTexParameterf ; cstyle
Function: glTexParameterfv   (  GLenum-target GLenum-pname GLfloat-*params -- )
Function: glTexParameteriv   (  GLenum-target GLenum-pname GLint-*params -- )
Function: glTexEnvi ( target param value -- )
Function: glTexEnvf ( target param value -- )
: glTexEnvf   1sfparms glTexEnvf ; cstyle
Function: glTexEnvfv  (  GLenum-target GLenum-pname GLfloat-*params -- )
Function: glTexEnviv   (  GLenum-target GLenum-pname GLint-*params -- )
Function: glTexGendv   (  GLenum-coord GLenum-pname GLdouble-*params -- )
Function: glTexGenfv   (  GLenum-coord GLenum-pname GLfloat-*params -- )
Function: glTexGeniv   (  GLenum-coord GLenum-pname GLint-*params -- )
Function: glTexImage1D  ( target level internal w border format type addr -- )
Function: glTexImage2D ( target level internal w h border format type addr -- )
Function: glTexSubImage2D ( target level x y w h format type addr -- )

Function: glTexCoord1i ( n -- )
Function: glTexCoord2i ( n n -- )
Function: glTexCoord3i ( n n n -- )
Function: glTexCoord1f ( n -- )
: glTexCoord1f  1sfparms glTexCoord1f ; cstyle
Function: glTexCoord2f ( n n -- )
: glTexCoord2f  2sfparms glTexCoord2f ; cstyle
Function: glTexCoord3f ( n n n -- )
: glTexCoord3f  3sfparms glTexCoord3f ; cstyle
Function: glTexCoord3i ( n n n -- )
Function: glTexCoord1iv ( a -- )
Function: glTexCoord1fv ( a -- )
Function: glTexCoord1dv ( a -- )
Function: glTexCoord2iv ( a -- )
Function: glTexCoord2fv ( a -- )
Function: glTexCoord2dv ( a -- )
Function: glTexCoord3iv ( a -- )
Function: glTexCoord3fv ( a -- )
Function: glTexCoord3dv ( a -- )

Function: glAreTexturesResident  ( GLsizei-n  GLuint-*textures GLboolean-*residences -- GLBoolean )
Function: glPrioritizeTextures (  GLsizei-n GLuint-*textures GLclampf-*priorities -- )

\ Attributes
Function: glPushAttrib ( mask -- )
Function: glPushClientAttrib ( mask -- )
Function: glPopAttrib ( -- )
Function: glPopClientAttrib ( -- )

\ Blending
Function: glAlphaFunc ( func ref -- )
: glAlphaFunc   1sfparms glAlphaFunc ; cstyle
Function: glBlendFunc ( source dest -- )
Function: glLogicOp ( n -- )

\ Scissor
Function: glScissor ( x y w h -- )
: glScissor   4sfparms glScissor ; cstyle

\ Depth buffer
Function: glDepthFunc ( func -- )
Function: glDepthMask ( flag -- )
Function: glDepthRange ( near near far far -- )
: glDepthRange   2df glDepthRange ; cstyle

\ Drawing
Function: glCullFace ( mode -- )
Function: glPolygonOffset ( factor units -- )
: glPolygonOffset   2sfparms glPolygonOffset ; cstyle
Function: glPolygonMode ( facemode mode -- )
Function: glColorMask  (  GLboolean-red GLboolean-green GLboolean-blue GLboolean-alpha -- )

Function: glColor3ubv ( a -- )
Function: glColor4ubv ( a -- )
Function: glColor3ub ( r g b -- )
Function: glColor4ub ( r g b a -- )
Function: glColor3fv ( addr -- )
Function: glColor4fv ( addr -- )
Function: glColor3f ( r g b -- )
: glColor3f   3sfparms glColor3f ; cstyle
Function: glColor4f ( r g b a -- )
: glColor4f   4sfparms glColor4f ; cstyle

Function: glVertex2i ( x y -- )
Function: glVertex3i ( x y z -- )
Function: glVertex2f ( x y -- )
: glVertex2f   2sfparms glVertex2f ; cstyle
Function: glVertex3f ( x y z -- )
: glVertex3f   3sfparms glVertex3f ; cstyle
Function: glVertex2iv ( a -- )
Function: glVertex2dv ( addr -- )
Function: glVertex2sv ( addr -- )
Function: glVertex2fv ( addr -- )
Function: glVertex3iv ( a -- )
Function: glVertex3fv ( addr -- )
Function: glVertex3sv ( addr -- )
Function: glVertex3dv ( addr -- )

Function: glRasterPos2i ( x y -- )
Function: glRasterPos3i ( x y z -- )

Function: glPixelZoom ( x y -- )
: glPixelZoom   2sfparms glPixelZoom ; cstyle
Function: glFrontFace ( mode -- )
Function: glBitmap ( w h . . xmove ymove addr -- )
: glBitmap  >r swap s>f s>f 2sfparms r> glBitmap ; cstyle
Function: glPointSize ( size -- )
Function: glLineStipple ( factor pattern -- )
Function: glLineWidth ( width -- )
: glLineWidth   1sfparms glLineWidth ; cstyle
Function: glPolygonStipple ( &mask -- )
Function: glEdgeFlag  ( flag -- )
Function: glRasterPos2f ( x y -- )
: glRasterPos2f   2sfparms glRasterPos2f ; cstyle
Function: glPointSize (  GLfloat-size -- )
: glPointSize 1sfparms glPointSize ; cstyle


\ Edge flags - ommitted

\ Evaluators
Function: glEvalCoord1f ( gl-float -- )
: glEvalCoord1f 1sfparms glEvalCoord1f ; cstyle
Function: glEvalCoord2f ( gl-float gl-float -- )
: glEvalCoord2f 2sfparms glEvalCoord2f ; cstyle
Function: glEvalCoord1dv ( addr -- )
Function: glEvalCoord2dv ( addr -- )
Function: glEvalCoord1fv ( addr -- )
Function: glEvalCoord2fv ( addr -- )
Function: glEvalMesh1 (  GLenum-mode GLint-i1 GLint-i2 -- )
Function: glEvalMesh2 ( GLenum-mode GLint-i1 GLint-i2 GLint-j1 GLint-j2 -- )
Function: glEvalPoint1 (  GLint-i -- )
Function: glEvalPoint2 (  GLint-i GLint-j -- )
Function: glMap2d   (  GLenum-target GLdouble-u1 . GLdouble-u2 . GLint-ustride GLint-uorder GLdouble-v1 . GLdouble-v2 . GLint-vstride GLint-vorder GLdouble-*points -- )
: glMap2d  >r >r >r 2df 2>r 2>r >r >r 4df r> r> 2r> 2r> r> r> r> glMap2d ; cstyle
Function: glMap2f   (  GLenum-target GLfloat-u1 GLfloat-u2 GLint-ustride GLint-uorder GLfloat-v1 GLfloat-v2 GLint-vstride GLint-vorder GLfloat-*points -- )
: glMap2f  >r >r >r 1sfparms 2>r >r >r 4sfparms r> r> 2r> r> r> r> glMap2f ; cstyle
Function: glMap1d   (  GLenum-target GLdouble-u1 . GLdouble-u2 . GLint-stride GLint-order GLdouble-*points -- )
: glMap1d  >r >r >r 2df r> r> r> glMap1d ; cstyle
Function: glMap1f   (  GLenum-target GLfloat-u1 GLfloat-u2 GLint-stride GLint-order GLfloat-*points -- )
: glMap1f   >r >r >r 2sfparms r> r> r> glMap1f ; cstyle
Function: glMapGrid1d  (  GLint-un  GLdouble-u1  GLdouble-u2 -- )
Function: glMapGrid1f  (  GLint-un  GLfloat-u1  GLfloat-u2 -- )
Function: glMapGrid2d  (  GLint-un  GLdouble-u1  GLdouble-u2  GLint-vn  GLdouble-v1 GLdouble-v2 -- )
Function: glMapGrid2f  (  GLint-un GLfloat-u1  GLfloat-u2  GLint-vn  GLfloat-v1 GLfloat-v2 -- )
: glMapGrid1d   2df glMapGrid1d ; cstyle
: glMapGrid1f   2sfparms glMapGrid1f ; cstyle
: glMapGrid2d   2df 2>r 2>r >r 2df 2r> 2r> r> glMapGrid2d ; cstyle
: glMapGrid2f   2sfparms 2>r >r 2sfparms 2r> r> glMapGrid2f ; cstyle

\ Vertex arrays
Function: glEnableClientState ( mode -- )
Function: glDisableClientState ( mode -- )
Function: glVertexPointer ( size type stride addr -- )
Function: glNormalPointer ( type stride addr -- )
Function: glColorPointer ( size type stride addr -- )
Function: glTexCoordPointer ( size type stride addr -- )
Function: glEdgeFlagPointer ( type stride addr -- )
Function: glArrayElement ( n -- )
Function: glInterleavedArrays  (  GLenum-format GLsizei-stride GLvoid-*pointer -- )
Function: glNormalPointer (  GLenum-type GLsizei-stride GLvoid-*pointer -- )
Function: glDrawArrays   (  GLenum-mode GLint-first GLsizei-count -- )
Function: glDrawElements ( primitive count type addr -- )

\ Lighting & Fog
Function: glLightModeli ( pname param -- )
Function: glLightModelf ( pname param -- )
: glLightModelf   1sfparms glLightModelf ; cstyle
Function: glLightModeliv ( pname addr -- )
Function: glLightModelfv ( pname addr -- )
Function: glShadeModel ( mode -- )
Function: glLightiv ( light param addr -- )
Function: glLightfv ( light param addr -- )
Function: glLightf  (  GLenum-light GLenum-pname GLfloat-param -- )
: glLightf  1sfparms glLightf ; cstyle
Function: glLighti  (  GLenum-light GLenum-pname GLint-param -- )
Function: glColorMaterial ( param n -- )
Function: glNormal3s ( X Y Z -- )
Function: glNormal3i ( X Y Z -- )
Function: glNormal3f ( X Y Z -- )
Function: glNormal3fv  (  addr -- )
Function: glNormal3iv  (  addr -- )
Function: glNormal3sv  (  addr -- )
: glNormal3f  3sfparms  glNormal3f ; cstyle
Function: glFogf ( param value -- )
: glFogf   1sfparms  glFogf ; cstyle
Function: glFogi (  GLenum-pname GLint-param -- )

\ WGL
1 IMPORT: wglGetProcAddress ( z$ -- addr )
Function: wglGetCurrentContext ( -- n )
Function: wglGetCurrentDC ( -- n )
Function: wglMakeCurrent ( dc rc -- )
Function: wglCopyContext ( src dest mask -- )

{
\ Feedback
Function: glRenderMode ( param -- n )
Function: glFeedbackBuffer ( n type addr -- )
Function: glPassThrough  (  GLfloat-token -- )
: glPassThrough  1sfparms glPassThrough ; cstyle
}

\ Imaging
Function: glPixelMapfv (  GLenum-map  GLint-mapsize  GLfloat-*values -- )
Function: glPixelMapuiv   (  GLenum-map  GLint-mapsize  GLuint-*values -- )
Function: glPixelMapusv   (  GLenum-map  GLint-mapsize  GLushort-*values -- )

\ Selection
Function: glInitNames ( -- )
Function: glLoadName  ( GLuint-name -- )
Function: glPushName ( name -- )
Function: glPopName ( -- )
Function: glSelectBuffer  (  GLsizei-size GLuint-*buffer -- )

\ Accumulation buffer
{
Function: glAccum ( op fvalue -- )
: glAccum   1sfparms glAccum ; cstyle
Function: glClearAccum (  GLfloat-red GLfloat-green GLfloat-blue GLfloat-alpha -- )
: glClearAccum 4sfparms glClearAccum ; cstyle
}

\ Depth buffer
Function: glClearDepth   (  GLclampd-depth.1 GLclampd-depth.2 -- )
: glClearDepth   1df glClearDepth ; cstyle

\ Color index buffers - ommitted

\ Stencil buffer
Function: glClearStencil  (  GLint-s -- )
Function: glStencilFunc ( func ref mask -- )
Function: glStencilMask ( mask -- )
Function: glStencilOp ( fail zfail zpass -- )

\ Copy pixels
Function: glCopyTexImage1D   (  GLenum-target GLint-level GLenum-internalformat GLint-x GLint-y GLsizei-width GLint-border -- )
Function: glCopyTexImage2D   (  GLenum-target GLint-level GLenum-internalformat GLint-x GLint-y GLsizei-width GLsizei-height GLint-border -- )
Function: glCopyPixels (  GLint-x GLint-y GLsizei-width GLsizei-height GLenum-type -- )
Function: glCopyTexSubImage1D   (  GLenum-target GLint-level GLint-xoffset GLint-x GLint-y GLsizei-width -- )
Function: glCopyTexSubImage2D   (  GLenum-target GLint-level GLint-xoffset GLint-yoffset GLint-x GLint-y GLsizei-width -- )
Function: glReadBuffer ( mode -- )

\ Read pixels
Function: glReadPixels   (   x y width height format type pixels -- )

\ Draw pixels - omitted

\ "Get" functions
Function: glGetClipPlane (  GLenum-plane GLdouble-*equation -- )
Function: glGetString ( n -- a )
Function: glGetError ( -- n )
Function: glGetMapdv   (  GLenum-target GLenum-query GLdouble-*v -- )
Function: glGetMapiv   (  GLenum-target GLenum-query GLfloat-*v -- )
Function: glGetMapfv   (  GLenum-target GLenum-query GLint-*v -- )
Function: glGetLightiv (  GLenum-light GLenum-pname GLfloat-*params -- )
Function: glGetLightfv (  GLenum-light GLenum-pname GLint-*params -- )
Function: glGetBooleanv ( param addr -- )
Function: glGetIntegerv ( param addr -- )
Function: glGetFloatv ( param addr -- )
Function: glGetDoublev ( param addr -- )

Function: glGetMaterialfv (  GLenum-face GLenum-pname GLfloat-*params -- )
Function: glGetMaterialiv (  GLenum-face GLenum-pname GLint-*params -- )
Function: glGetPixelMapfv (  GLenum-mmap GLfloat- *values -- )
Function: glGetPixelMapuiv   (  GLenum-map GLuint-*values -- )
Function: glGetPixelMapusv   (  GLenum-map GLushort-*values -- )
Function: glGetPointerv   (  GLenum-pname GLvoid*-*params -- )
Function: glGetPolygonStipple   (  GLubyte-*mask -- )
Function: glGetString   (  GLenum-name -- addr )
Function: glGetTexEnvfv  (  GLenum-target GLenum-pname GLfloat-*params -- )
Function: glGetTexEnviv   (  GLenum-target GLenum-pname GLint-*params -- )
Function: glGetTexGendv   (  GLenum-coord GLenum-pname GLdouble-*params -- )
Function: glGetTexGenfv   (  GLenum-coord GLenum-pname GLfloat-*params -- )
Function: glGetTexGeniv   (  GLenum-coord GLenum-pname GLint-*params -- )
Function: glGetTexImage  (   target level format type pixels -- )
Function: glGetTexLevelParameterfv (  GLenum-target GLint-level GLenum-pname GLfloat-*params -- )
Function: glGetTexLevelParameteriv (  GLenum-target GLint-level GLenum-pname GLint-*params -- )
Function: glGetTexParameterfv   (  GLenum-target GLenum-pname GLfloat-*params -- )
Function: glGetTexParameteriv   (  GLenum-target GLenum-pname GLint-*params -- )

\ "Is" functions
Function: glIsEnabled (  GLenum-cap -- flag )
Function: glIsList   (  GLuint-list -- flag )
Function: glIsTexture   (  GLuint-tex -- flag )

\ OpenGL 1.1 constants are automatically found by the SwiftForth Compiler
\  Here are the constants for versions 1.2 through 2.1, from glext.h

\ #fndef GL_VERSION_1_2
#define GL_UNSIGNED_BYTE_3_3_2            $8032
#define GL_UNSIGNED_SHORT_4_4_4_4         $8033
#define GL_UNSIGNED_SHORT_5_5_5_1         $8034
#define GL_UNSIGNED_INT_8_8_8_8           $8035
#define GL_UNSIGNED_INT_10_10_10_2        $8036
#define GL_TEXTURE_BINDING_3D             $806A
#define GL_PACK_SKIP_IMAGES               $806B
#define GL_PACK_IMAGE_HEIGHT              $806C
#define GL_UNPACK_SKIP_IMAGES             $806D
#define GL_UNPACK_IMAGE_HEIGHT            $806E
#define GL_TEXTURE_3D                     $806F
#define GL_PROXY_TEXTURE_3D               $8070
#define GL_TEXTURE_DEPTH                  $8071
#define GL_TEXTURE_WRAP_R                 $8072
#define GL_MAX_3D_TEXTURE_SIZE            $8073
#define GL_UNSIGNED_BYTE_2_3_3_REV        $8362
#define GL_UNSIGNED_SHORT_5_6_5           $8363
#define GL_UNSIGNED_SHORT_5_6_5_REV       $8364
#define GL_UNSIGNED_SHORT_4_4_4_4_REV     $8365
#define GL_UNSIGNED_SHORT_1_5_5_5_REV     $8366
#define GL_UNSIGNED_INT_8_8_8_8_REV       $8367
#define GL_UNSIGNED_INT_2_10_10_10_REV    $8368
#define GL_BGR                            $80E0
#define GL_BGRA                           $80E1
#define GL_MAX_ELEMENTS_VERTICES          $80E8
#define GL_MAX_ELEMENTS_INDICES           $80E9
#define GL_CLAMP_TO_EDGE                  $812F
#define GL_TEXTURE_MIN_LOD                $813A
#define GL_TEXTURE_MAX_LOD                $813B
#define GL_TEXTURE_BASE_LEVEL             $813C
#define GL_TEXTURE_MAX_LEVEL              $813D
#define GL_SMOOTH_POINT_SIZE_RANGE        $0B12
#define GL_SMOOTH_POINT_SIZE_GRANULARITY  $0B13
#define GL_SMOOTH_LINE_WIDTH_RANGE        $0B22
#define GL_SMOOTH_LINE_WIDTH_GRANULARITY  $0B23
#define GL_ALIASED_LINE_WIDTH_RANGE       $846E
\ #endif

\ #fndef GL_VERSION_1_2_DEPRECATED
#define GL_RESCALE_NORMAL                 $803A
#define GL_LIGHT_MODEL_COLOR_CONTROL      $81F8
#define GL_SINGLE_COLOR                   $81F9
#define GL_SEPARATE_SPECULAR_COLOR        $81FA
#define GL_ALIASED_POINT_SIZE_RANGE       $846D
\ #endif

\ #fndef GL_ARB_imaging
#define GL_CONSTANT_COLOR                 $8001
#define GL_ONE_MINUS_CONSTANT_COLOR       $8002
#define GL_CONSTANT_ALPHA                 $8003
#define GL_ONE_MINUS_CONSTANT_ALPHA       $8004
#define GL_BLEND_COLOR                    $8005
#define GL_FUNC_ADD                       $8006
#define GL_MIN                            $8007
#define GL_MAX                            $8008
#define GL_BLEND_EQUATION                 $8009
#define GL_FUNC_SUBTRACT                  $800A
#define GL_FUNC_REVERSE_SUBTRACT          $800B
\ #endif

\ #fndef GL_ARB_imaging_DEPRECATED
#define GL_CONVOLUTION_1D                 $8010
#define GL_CONVOLUTION_2D                 $8011
#define GL_SEPARABLE_2D                   $8012
#define GL_CONVOLUTION_BORDER_MODE        $8013
#define GL_CONVOLUTION_FILTER_SCALE       $8014
#define GL_CONVOLUTION_FILTER_BIAS        $8015
#define GL_REDUCE                         $8016
#define GL_CONVOLUTION_FORMAT             $8017
#define GL_CONVOLUTION_WIDTH              $8018
#define GL_CONVOLUTION_HEIGHT             $8019
#define GL_MAX_CONVOLUTION_WIDTH          $801A
#define GL_MAX_CONVOLUTION_HEIGHT         $801B
#define GL_POST_CONVOLUTION_RED_SCALE     $801C
#define GL_POST_CONVOLUTION_GREEN_SCALE   $801D
#define GL_POST_CONVOLUTION_BLUE_SCALE    $801E
#define GL_POST_CONVOLUTION_ALPHA_SCALE   $801F
#define GL_POST_CONVOLUTION_RED_BIAS      $8020
#define GL_POST_CONVOLUTION_GREEN_BIAS    $8021
#define GL_POST_CONVOLUTION_BLUE_BIAS     $8022
#define GL_POST_CONVOLUTION_ALPHA_BIAS    $8023
#define GL_HISTOGRAM                      $8024
#define GL_PROXY_HISTOGRAM                $8025
#define GL_HISTOGRAM_WIDTH                $8026
#define GL_HISTOGRAM_FORMAT               $8027
#define GL_HISTOGRAM_RED_SIZE             $8028
#define GL_HISTOGRAM_GREEN_SIZE           $8029
#define GL_HISTOGRAM_BLUE_SIZE            $802A
#define GL_HISTOGRAM_ALPHA_SIZE           $802B
#define GL_HISTOGRAM_LUMINANCE_SIZE       $802C
#define GL_HISTOGRAM_SINK                 $802D
#define GL_MINMAX                         $802E
#define GL_MINMAX_FORMAT                  $802F
#define GL_MINMAX_SINK                    $8030
#define GL_TABLE_TOO_LARGE                $8031
#define GL_COLOR_MATRIX                   $80B1
#define GL_COLOR_MATRIX_STACK_DEPTH       $80B2
#define GL_MAX_COLOR_MATRIX_STACK_DEPTH   $80B3
#define GL_POST_COLOR_MATRIX_RED_SCALE    $80B4
#define GL_POST_COLOR_MATRIX_GREEN_SCALE  $80B5
#define GL_POST_COLOR_MATRIX_BLUE_SCALE   $80B6
#define GL_POST_COLOR_MATRIX_ALPHA_SCALE  $80B7
#define GL_POST_COLOR_MATRIX_RED_BIAS     $80B8
#define GL_POST_COLOR_MATRIX_GREEN_BIAS   $80B9
#define GL_POST_COLOR_MATRIX_BLUE_BIAS    $80BA
#define GL_POST_COLOR_MATRIX_ALPHA_BIAS   $80BB
#define GL_COLOR_TABLE                    $80D0
#define GL_POST_CONVOLUTION_COLOR_TABLE   $80D1
#define GL_POST_COLOR_MATRIX_COLOR_TABLE  $80D2
#define GL_PROXY_COLOR_TABLE              $80D3
#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE $80D4
#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE $80D5
#define GL_COLOR_TABLE_SCALE              $80D6
#define GL_COLOR_TABLE_BIAS               $80D7
#define GL_COLOR_TABLE_FORMAT             $80D8
#define GL_COLOR_TABLE_WIDTH              $80D9
#define GL_COLOR_TABLE_RED_SIZE           $80DA
#define GL_COLOR_TABLE_GREEN_SIZE         $80DB
#define GL_COLOR_TABLE_BLUE_SIZE          $80DC
#define GL_COLOR_TABLE_ALPHA_SIZE         $80DD
#define GL_COLOR_TABLE_LUMINANCE_SIZE     $80DE
#define GL_COLOR_TABLE_INTENSITY_SIZE     $80DF
#define GL_CONSTANT_BORDER                $8151
#define GL_REPLICATE_BORDER               $8153
#define GL_CONVOLUTION_BORDER_COLOR       $8154
\ #endif

\ #fndef GL_VERSION_1_3
#define GL_TEXTURE0                       $84C0
#define GL_TEXTURE1                       $84C1
#define GL_TEXTURE2                       $84C2
#define GL_TEXTURE3                       $84C3
#define GL_TEXTURE4                       $84C4
#define GL_TEXTURE5                       $84C5
#define GL_TEXTURE6                       $84C6
#define GL_TEXTURE7                       $84C7
#define GL_TEXTURE8                       $84C8
#define GL_TEXTURE9                       $84C9
#define GL_TEXTURE10                      $84CA
#define GL_TEXTURE11                      $84CB
#define GL_TEXTURE12                      $84CC
#define GL_TEXTURE13                      $84CD
#define GL_TEXTURE14                      $84CE
#define GL_TEXTURE15                      $84CF
#define GL_TEXTURE16                      $84D0
#define GL_TEXTURE17                      $84D1
#define GL_TEXTURE18                      $84D2
#define GL_TEXTURE19                      $84D3
#define GL_TEXTURE20                      $84D4
#define GL_TEXTURE21                      $84D5
#define GL_TEXTURE22                      $84D6
#define GL_TEXTURE23                      $84D7
#define GL_TEXTURE24                      $84D8
#define GL_TEXTURE25                      $84D9
#define GL_TEXTURE26                      $84DA
#define GL_TEXTURE27                      $84DB
#define GL_TEXTURE28                      $84DC
#define GL_TEXTURE29                      $84DD
#define GL_TEXTURE30                      $84DE
#define GL_TEXTURE31                      $84DF
#define GL_ACTIVE_TEXTURE                 $84E0
#define GL_MULTISAMPLE                    $809D
#define GL_SAMPLE_ALPHA_TO_COVERAGE       $809E
#define GL_SAMPLE_ALPHA_TO_ONE            $809F
#define GL_SAMPLE_COVERAGE                $80A0
#define GL_SAMPLE_BUFFERS                 $80A8
#define GL_SAMPLES                        $80A9
#define GL_SAMPLE_COVERAGE_VALUE          $80AA
#define GL_SAMPLE_COVERAGE_INVERT         $80AB
#define GL_TEXTURE_CUBE_MAP               $8513
#define GL_TEXTURE_BINDING_CUBE_MAP       $8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    $8515
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    $8516
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    $8517
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    $8518
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    $8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    $851A
#define GL_PROXY_TEXTURE_CUBE_MAP         $851B
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      $851C
#define GL_COMPRESSED_RGB                 $84ED
#define GL_COMPRESSED_RGBA                $84EE
#define GL_TEXTURE_COMPRESSION_HINT       $84EF
#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE  $86A0
#define GL_TEXTURE_COMPRESSED             $86A1
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS $86A2
#define GL_COMPRESSED_TEXTURE_FORMATS     $86A3
#define GL_CLAMP_TO_BORDER                $812D
\ #endif

\ #fndef GL_VERSION_1_3_DEPRECATED
#define GL_CLIENT_ACTIVE_TEXTURE          $84E1
#define GL_MAX_TEXTURE_UNITS              $84E2
#define GL_TRANSPOSE_MODELVIEW_MATRIX     $84E3
#define GL_TRANSPOSE_PROJECTION_MATRIX    $84E4
#define GL_TRANSPOSE_TEXTURE_MATRIX       $84E5
#define GL_TRANSPOSE_COLOR_MATRIX         $84E6
#define GL_MULTISAMPLE_BIT                $20000000
#define GL_NORMAL_MAP                     $8511
#define GL_REFLECTION_MAP                 $8512
#define GL_COMPRESSED_ALPHA               $84E9
#define GL_COMPRESSED_LUMINANCE           $84EA
#define GL_COMPRESSED_LUMINANCE_ALPHA     $84EB
#define GL_COMPRESSED_INTENSITY           $84EC
#define GL_COMBINE                        $8570
#define GL_COMBINE_RGB                    $8571
#define GL_COMBINE_ALPHA                  $8572
#define GL_SOURCE0_RGB                    $8580
#define GL_SOURCE1_RGB                    $8581
#define GL_SOURCE2_RGB                    $8582
#define GL_SOURCE0_ALPHA                  $8588
#define GL_SOURCE1_ALPHA                  $8589
#define GL_SOURCE2_ALPHA                  $858A
#define GL_OPERAND0_RGB                   $8590
#define GL_OPERAND1_RGB                   $8591
#define GL_OPERAND2_RGB                   $8592
#define GL_OPERAND0_ALPHA                 $8598
#define GL_OPERAND1_ALPHA                 $8599
#define GL_OPERAND2_ALPHA                 $859A
#define GL_RGB_SCALE                      $8573
#define GL_ADD_SIGNED                     $8574
#define GL_INTERPOLATE                    $8575
#define GL_SUBTRACT                       $84E7
#define GL_CONSTANT                       $8576
#define GL_PRIMARY_COLOR                  $8577
#define GL_PREVIOUS                       $8578
#define GL_DOT3_RGB                       $86AE
#define GL_DOT3_RGBA                      $86AF
\ #endif

\ #fndef GL_VERSION_1_4
#define GL_BLEND_DST_RGB                  $80C8
#define GL_BLEND_SRC_RGB                  $80C9
#define GL_BLEND_DST_ALPHA                $80CA
#define GL_BLEND_SRC_ALPHA                $80CB
#define GL_POINT_FADE_THRESHOLD_SIZE      $8128
#define GL_DEPTH_COMPONENT16              $81A5
#define GL_DEPTH_COMPONENT24              $81A6
#define GL_DEPTH_COMPONENT32              $81A7
#define GL_MIRRORED_REPEAT                $8370
#define GL_MAX_TEXTURE_LOD_BIAS           $84FD
#define GL_TEXTURE_LOD_BIAS               $8501
#define GL_INCR_WRAP                      $8507
#define GL_DECR_WRAP                      $8508
#define GL_TEXTURE_DEPTH_SIZE             $884A
#define GL_TEXTURE_COMPARE_MODE           $884C
#define GL_TEXTURE_COMPARE_FUNC           $884D
\ #endif

\ #fndef GL_VERSION_1_4_DEPRECATED
#define GL_POINT_SIZE_MIN                 $8126
#define GL_POINT_SIZE_MAX                 $8127
#define GL_POINT_DISTANCE_ATTENUATION     $8129
#define GL_GENERATE_MIPMAP                $8191
#define GL_GENERATE_MIPMAP_HINT           $8192
#define GL_FOG_COORDINATE_SOURCE          $8450
#define GL_FOG_COORDINATE                 $8451
#define GL_FRAGMENT_DEPTH                 $8452
#define GL_CURRENT_FOG_COORDINATE         $8453
#define GL_FOG_COORDINATE_ARRAY_TYPE      $8454
#define GL_FOG_COORDINATE_ARRAY_STRIDE    $8455
#define GL_FOG_COORDINATE_ARRAY_POINTER   $8456
#define GL_FOG_COORDINATE_ARRAY           $8457
#define GL_COLOR_SUM                      $8458
#define GL_CURRENT_SECONDARY_COLOR        $8459
#define GL_SECONDARY_COLOR_ARRAY_SIZE     $845A
#define GL_SECONDARY_COLOR_ARRAY_TYPE     $845B
#define GL_SECONDARY_COLOR_ARRAY_STRIDE   $845C
#define GL_SECONDARY_COLOR_ARRAY_POINTER  $845D
#define GL_SECONDARY_COLOR_ARRAY          $845E
#define GL_TEXTURE_FILTER_CONTROL         $8500
#define GL_DEPTH_TEXTURE_MODE             $884B
#define GL_COMPARE_R_TO_TEXTURE           $884E
\ #endif

\ #fndef GL_VERSION_1_5
#define GL_BUFFER_SIZE                    $8764
#define GL_BUFFER_USAGE                   $8765
#define GL_QUERY_COUNTER_BITS             $8864
#define GL_CURRENT_QUERY                  $8865
#define GL_QUERY_RESULT                   $8866
#define GL_QUERY_RESULT_AVAILABLE         $8867
#define GL_ARRAY_BUFFER                   $8892
#define GL_ELEMENT_ARRAY_BUFFER           $8893
#define GL_ARRAY_BUFFER_BINDING           $8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING   $8895
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING $889F
#define GL_READ_ONLY                      $88B8
#define GL_WRITE_ONLY                     $88B9
#define GL_READ_WRITE                     $88BA
#define GL_BUFFER_ACCESS                  $88BB
#define GL_BUFFER_MAPPED                  $88BC
#define GL_BUFFER_MAP_POINTER             $88BD
#define GL_STREAM_DRAW                    $88E0
#define GL_STREAM_READ                    $88E1
#define GL_STREAM_COPY                    $88E2
#define GL_STATIC_DRAW                    $88E4
#define GL_STATIC_READ                    $88E5
#define GL_STATIC_COPY                    $88E6
#define GL_DYNAMIC_DRAW                   $88E8
#define GL_DYNAMIC_READ                   $88E9
#define GL_DYNAMIC_COPY                   $88EA
#define GL_SAMPLES_PASSED                 $8914
\ #endif

\ #fndef GL_VERSION_1_5_DEPRECATED
#define GL_VERTEX_ARRAY_BUFFER_BINDING    $8896
#define GL_NORMAL_ARRAY_BUFFER_BINDING    $8897
#define GL_COLOR_ARRAY_BUFFER_BINDING     $8898
#define GL_INDEX_ARRAY_BUFFER_BINDING     $8899
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING $889A
#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING $889B
#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING $889C
#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING $889D
#define GL_WEIGHT_ARRAY_BUFFER_BINDING    $889E
#define GL_FOG_COORD_SRC                  $8450
#define GL_FOG_COORD                      $8451
#define GL_CURRENT_FOG_COORD              $8453
#define GL_FOG_COORD_ARRAY_TYPE           $8454
#define GL_FOG_COORD_ARRAY_STRIDE         $8455
#define GL_FOG_COORD_ARRAY_POINTER        $8456
#define GL_FOG_COORD_ARRAY                $8457
#define GL_FOG_COORD_ARRAY_BUFFER_BINDING $889D
#define GL_SRC0_RGB                       $8580
#define GL_SRC1_RGB                       $8581
#define GL_SRC2_RGB                       $8582
#define GL_SRC0_ALPHA                     $8588
#define GL_SRC1_ALPHA                     $8589
#define GL_SRC2_ALPHA                     $858A
\ #endif

\ #fndef GL_VERSION_2_0
#define GL_BLEND_EQUATION_RGB             $8009
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    $8622
#define GL_VERTEX_ATTRIB_ARRAY_SIZE       $8623
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     $8624
#define GL_VERTEX_ATTRIB_ARRAY_TYPE       $8625
#define GL_CURRENT_VERTEX_ATTRIB          $8626
#define GL_VERTEX_PROGRAM_POINT_SIZE      $8642
#define GL_VERTEX_ATTRIB_ARRAY_POINTER    $8645
#define GL_STENCIL_BACK_FUNC              $8800
#define GL_STENCIL_BACK_FAIL              $8801
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   $8802
#define GL_STENCIL_BACK_PASS_DEPTH_PASS   $8803
#define GL_MAX_DRAW_BUFFERS               $8824
#define GL_DRAW_BUFFER0                   $8825
#define GL_DRAW_BUFFER1                   $8826
#define GL_DRAW_BUFFER2                   $8827
#define GL_DRAW_BUFFER3                   $8828
#define GL_DRAW_BUFFER4                   $8829
#define GL_DRAW_BUFFER5                   $882A
#define GL_DRAW_BUFFER6                   $882B
#define GL_DRAW_BUFFER7                   $882C
#define GL_DRAW_BUFFER8                   $882D
#define GL_DRAW_BUFFER9                   $882E
#define GL_DRAW_BUFFER10                  $882F
#define GL_DRAW_BUFFER11                  $8830
#define GL_DRAW_BUFFER12                  $8831
#define GL_DRAW_BUFFER13                  $8832
#define GL_DRAW_BUFFER14                  $8833
#define GL_DRAW_BUFFER15                  $8834
#define GL_BLEND_EQUATION_ALPHA           $883D
#define GL_MAX_VERTEX_ATTRIBS             $8869
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED $886A
#define GL_MAX_TEXTURE_IMAGE_UNITS        $8872
#define GL_FRAGMENT_SHADER                $8B30
#define GL_VERTEX_SHADER                  $8B31
#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS $8B49
#define GL_MAX_VERTEX_UNIFORM_COMPONENTS  $8B4A
#define GL_MAX_VARYING_FLOATS             $8B4B
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS $8B4C
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS $8B4D
#define GL_SHADER_TYPE                    $8B4F
#define GL_FLOAT_VEC2                     $8B50
#define GL_FLOAT_VEC3                     $8B51
#define GL_FLOAT_VEC4                     $8B52
#define GL_INT_VEC2                       $8B53
#define GL_INT_VEC3                       $8B54
#define GL_INT_VEC4                       $8B55
#define GL_BOOL                           $8B56
#define GL_BOOL_VEC2                      $8B57
#define GL_BOOL_VEC3                      $8B58
#define GL_BOOL_VEC4                      $8B59
#define GL_FLOAT_MAT2                     $8B5A
#define GL_FLOAT_MAT3                     $8B5B
#define GL_FLOAT_MAT4                     $8B5C
#define GL_SAMPLER_1D                     $8B5D
#define GL_SAMPLER_2D                     $8B5E
#define GL_SAMPLER_3D                     $8B5F
#define GL_SAMPLER_CUBE                   $8B60
#define GL_SAMPLER_1D_SHADOW              $8B61
#define GL_SAMPLER_2D_SHADOW              $8B62
#define GL_DELETE_STATUS                  $8B80
#define GL_COMPILE_STATUS                 $8B81
#define GL_LINK_STATUS                    $8B82
#define GL_VALIDATE_STATUS                $8B83
#define GL_INFO_LOG_LENGTH                $8B84
#define GL_ATTACHED_SHADERS               $8B85
#define GL_ACTIVE_UNIFORMS                $8B86
#define GL_ACTIVE_UNIFORM_MAX_LENGTH      $8B87
#define GL_SHADER_SOURCE_LENGTH           $8B88
#define GL_ACTIVE_ATTRIBUTES              $8B89
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    $8B8A
#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT $8B8B
#define GL_SHADING_LANGUAGE_VERSION       $8B8C
#define GL_CURRENT_PROGRAM                $8B8D
#define GL_POINT_SPRITE_COORD_ORIGIN      $8CA0
#define GL_LOWER_LEFT                     $8CA1
#define GL_UPPER_LEFT                     $8CA2
#define GL_STENCIL_BACK_REF               $8CA3
#define GL_STENCIL_BACK_VALUE_MASK        $8CA4
#define GL_STENCIL_BACK_WRITEMASK         $8CA5
\ #endif

\ #fndef GL_VERSION_2_0_DEPRECATED
#define GL_VERTEX_PROGRAM_TWO_SIDE        $8643
#define GL_POINT_SPRITE                   $8861
#define GL_COORD_REPLACE                  $8862
#define GL_MAX_TEXTURE_COORDS             $8871
\ #endif

\ #fndef GL_VERSION_2_1
#define GL_PIXEL_PACK_BUFFER              $88EB
#define GL_PIXEL_UNPACK_BUFFER            $88EC
#define GL_PIXEL_PACK_BUFFER_BINDING      $88ED
#define GL_PIXEL_UNPACK_BUFFER_BINDING    $88EF
#define GL_FLOAT_MAT2x3                   $8B65
#define GL_FLOAT_MAT2x4                   $8B66
#define GL_FLOAT_MAT3x2                   $8B67
#define GL_FLOAT_MAT3x4                   $8B68
#define GL_FLOAT_MAT4x2                   $8B69
#define GL_FLOAT_MAT4x3                   $8B6A
#define GL_SRGB                           $8C40
#define GL_SRGB8                          $8C41
#define GL_SRGB_ALPHA                     $8C42
#define GL_SRGB8_ALPHA8                   $8C43
#define GL_COMPRESSED_SRGB                $8C48
#define GL_COMPRESSED_SRGB_ALPHA          $8C49
\ #endif

\ #fndef GL_VERSION_2_1_DEPRECATED
#define GL_CURRENT_RASTER_SECONDARY_COLOR $845F
#define GL_SLUMINANCE_ALPHA               $8C44
#define GL_SLUMINANCE8_ALPHA8             $8C45
#define GL_SLUMINANCE                     $8C46
#define GL_SLUMINANCE8                    $8C47
#define GL_COMPRESSED_SLUMINANCE          $8C4A
#define GL_COMPRESSED_SLUMINANCE_ALPHA    $8C4B
\ #endif

warning on
